home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PAS_0693
/
RSANCRPT.TXT
< prev
next >
Wrap
Text File
|
1993-06-02
|
2KB
|
48 lines
─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 362 of 362
From : Steve P. 1:141/410.0 31 May 93 23:38
To : Justin Broste
Subj : Encryption Alg.
────────────────────────────────────────────────────────────────────────────────
This method of encryption is called RSA Encryption, it's a form of public key
encryption. The encryption algorithm is..
C = M to the power of e MOD n
C is the encrypted byte(s)
M is the original byte(s)
e is a prime number
n is the product of 2 prime numbers ( p and q )
This will only work if gcd(e, (p-1)(q-1)) = 1..
Some #'s to use are...
e = 13
p = 43
q = 59
with these value the algorithm is C = M to the power of 13 MOD 2537...
To decrypt you must get the inverse of e MOD (p-1)(q-1)
When the values mentioned the inverse of e MOD (p-1)(q-1) is 937...
The decryption key is
P = C to the power of 937 MOD 2537
P is the original byte(s)
C is the encrypted byte(s)
937 is the inverse of 13 MOD (p-1)(q-1)
2537 is p * q
It's not an easy form of encryption, but it's secure.... You can give
someone the encryption key, but the would need to know the prime #'s p and q
to decrypt it ( which if you use big enough numbers, it would take quit some
time to figure them out)..
--- Maximus 2.00
* Origin: Ho-Bo's House of Ill Repute (1:141/410)